//
//  NSTimer+ADUtil.m
//  ADKit
//
//  Created by adu on 2018/9/10.
//

#import "NSTimer+ADUtil.h"

@implementation NSTimer (ADUtil)

- (void)ad_pauseTimer {
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate distantFuture]];
}


- (void)ad_resumeTimer {
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate date]];
}

- (void)ad_resumeTimerAfterTimeInterval:(NSTimeInterval)interval {
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
}

@end
